<%@ page language="java" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<nav class="navbar-default navbar-static-side" role="navigation">
    <div class="nav-close"><i class="fa fa-times-circle"></i>
    </div>
    <div class="sidebar-collapse">
        <ul class="nav" id="side-menu">
            <li class="nav-header">
                <div class="dropdown profile-element">
                    <h2>EH管理系统</h2>
                    <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                <span class="clear">
                                <span class="text-muted text-xs block"><shiro:user><shiro:principal property="name"/></shiro:user><b class="caret"></b></span>
                                </span>
                    </a>
                    <ul class="dropdown-menu animated fadeInRight m-t-xs">
                        <li><a class="J_menuItem" href="form_avatar.html">修改头像</a>
                        </li>
                        <li><a class="J_menuItem" href="profile.html">个人资料</a>
                        </li>
                        <li><a class="J_menuItem" href="contacts.html">联系我们</a>
                        </li>
                        <li><a class="J_menuItem" href="mailbox.html">信箱</a>
                        </li>
                        <li class="divider"></li>
                        <li><a href="${ctx}/logout">安全退出</a>
                        </li>
                    </ul>
                </div>
                <div class="logo-element">H+
                </div>
            </li>
            <c:forEach items="${menus}" var="menu">
                <c:if test="${menu.pid == 0}">
                <li>
                    <a <c:if test="${menu.url !='#'}"> class="J_menuItem" </c:if> href="${empty menu.url ? '#': (ctx.concat(menu.url))}"><i class="${menu.icon}"></i> <span class="nav-label">${menu.title}</span><span class="fa arrow"></span></a>
                    <ul class="nav nav-second-level">
                    <c:forEach items="${menus}" var="item">
                    <c:if test="${item.pid == menu.id}">
                        <li><a class="J_menuItem" href="${ctx}/${item.url}">${item.title}</a></li>
                    </c:if>
                    </c:forEach>
                    </ul>
                </li>
                </c:if>
            </c:forEach>
        </ul>
    </div>
</nav>